<script setup>
import itemData from '../data/ItemData.json'
import { getText } from '../store/txtstore.js'
const props = defineProps(['itemId', 'num', 'showName'])
const item = itemData.data[props.itemId]
const text = [props.showName ? getText(item[2][1]) : '']
if (props.num > 0) {
    text.push(props.showName ? '×' : ' ', props.num)
}
</script>

<template>
    <span>
        <img :src="`/exilium/icons/item/${item[6]}.png`">
        {{ text.join('') }}
    </span>
</template>

<style scoped>
span {
    align-items: center;
    display: inline-flex;
}

img {
    width: 1.5em;
}
</style>